import request from "@/utils/request";

// 查询用户列表
export function listUser(query) {
  return request({
    url: "/business/user/list",
    method: "get",
    params: query,
  });
}

// 查询用户所有列表
export function listAllUser(query) {
  return request({
    url: "/business/user/listAll",
    method: "get",
    params: query,
  });
}

// 查询用户详细
export function getUser(uid) {
  return request({
    url: "/business/user/getInfo/" + uid,
    method: "get",
  });
}

export function getParentPhoneApi(uid) {
  return request({
    url: "/business/user/getParentPhone/" + uid,
    method: "get",
  });
}
// 新增用户
export function addUser(data) {
  return request({
    url: "/business/user/add",
    method: "post",
    data: data,
  });
}

// 修改用户
export function updateUser(data) {
  return request({
    url: "/business/user/edit",
    method: "post",
    data: data,
  });
}

// 删除用户
export function delUser(uid) {
  return request({
    url: "/business/user/remove/" + uid,
    method: "get",
  });
}

// 下单
export function addOrder(data) {
  return request({
    url: "/business/storeOrder/add",
    method: "post",
    data: data,
  });
}
// 设置代理商
export function agentApi(data) {
  return request({
    url: "/business/user/agent",
    method: "post",
    data: data,
  });
}
